/*
 * @Author: yangni 920556271@qq.com
 * @Date: 2023-12-25 17:42:54
 * @LastEditors: yangni 920556271@qq.com
 * @LastEditTime: 2024-04-16 16:45:48
 * @FilePath: /yt-devops/lib/pages/devices/device_tab/device_detail/ems/ems_detail/ems_detail_model.dart
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import 'package:get/get.dart';
import 'package:yt_devops/resources/str_res_keys.dart';
import 'package:yt_devops/utils/enums.dart';
import 'package:yt_devops/utils/formats.dart';

import '../../../model/device_item_model.dart';

class EmsDetaiModel {
  List<DetailItemModel> controllItems = [
    DetailItemModel(
      label: 'siteMonitor.systemModel'.tr, // 系统模式
      field: 'sysModel',
    ),
    DetailItemModel(
      label: 'EMS${'siteMonitor.runningState'.tr}', // 运行状态
      field: 'emsSysStatus',
    ),
    DetailItemModel(
      label: 'siteMonitor.mainContactorStatus'.tr, // 主接触器状态
      field: 'MainContactorStatus',
    ),
    DetailItemModel(
      label: 'siteMonitor.aerosolSignal'.tr, // 气溶胶信号
      field: 'AerosolSignal',
    ),
    DetailItemModel(
      label: 'BMS${'siteMonitor.scramSignal'.tr}', //急停信号
      field: 'BmsStopSignal',
    ),
    DetailItemModel(
      label: 'siteMonitor.electricalScramSignal'.tr, // 电气急停信号
      field: 'EmergencyStopSignal',
    ),
    DetailItemModel(
      label: ResKey.deviceParallelOffGridMode.tr, // 并离网模式
      field: 'parallelOffGridMode',
      format: Formates.parallelGridFormat,
      show: (value, model) =>
          model?.productId == ProductIDType.react100XEmsEnergy.value,
    ),
  ];

  List<DetailItemModel> protectItems = [
    DetailItemModel(
      label: 'siteMonitor.overchargeProtection'.tr, // 过充保护
      field: 'OverchargeProtection',
    ),
    DetailItemModel(
      label: 'siteMonitor.overchargeRelease'.tr, // 过充释放
      field: 'OverchargeRelease',
    ),
    DetailItemModel(
      label: 'siteMonitor.overDischargeProtection'.tr, // 过放保护
      field: 'OverdischargeProtection',
    ),
    DetailItemModel(
      label: 'siteMonitor.overrelease'.tr, // 过放释放
      field: 'Overrelease',
    ),
  ];

  List<DetailItemModel> runItems = [
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}1', //'时段1',
      field: 'period1',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'
            .tr, //  'siteMonitor.executionPower'.tr, //执行功率,
        field: 'PCSPeriodPowerOne',
        format: Formates.powerFormat),
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}2', //'时段2',
      field: 'period2',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'.tr, //执行功率
        field: 'PCSPeriodPowerTwo',
        format: Formates.powerFormat),
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}3', //'时段3',
      field: 'period3',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'.tr, //执行功率,
        field: 'PCSPeriodPowerThree',
        format: Formates.powerFormat),
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}4', // '时段4',
      field: 'period4',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'.tr, //执行功率,
        field: 'PCSPeriodPowerFour',
        format: Formates.powerFormat),
    DetailItemModel(
      label: '${'siteMonitor.TimePeriod'.tr}5', // '时段5',
      field: 'period5',
    ),
    DetailItemModel(
        label: 'siteMonitor.executionPower'.tr, //执行功率,
        field: 'PCSPeriodPowerFive',
        format: Formates.powerFormat),
  ];

  Map<String, String> powerMap = {
    'power1': 'PCSPeriodPowerOne',
    'power2': 'PCSPeriodPowerTwo',
    'power3': 'PCSPeriodPowerThree',
    'power4': 'PCSPeriodPowerFour',
    'power5': 'PCSPeriodPowerFive',
  };

  Map<String, List<String>> timeMap = {
    'time1': [
      'AtTheBeginningOfThePeriodOne',
      'StartingPointOfTimePeriodOne',
      'AtTheEndOfThePeriodOne',
      'PeriodEndMinuteOne',
    ],
    'time2': [
      'AtTheBeginningOfThePeriodTwo',
      'StartingPointOfTimePeriodTwo',
      'AtTheEndOfThePeriodTwo',
      'PeriodEndMinuteTwo',
    ],
    'time3': [
      'AtTheBeginningOfThePeriodThree',
      'StartingPointOfTimePeriodThree',
      'AtTheEndOfThePeriodThree',
      'PeriodEndMinuteThree',
    ],
    'time4': [
      'AtTheBeginningOfThePeriodFour',
      'StartingPointOfTimePeriodFour',
      'AtTheEndOfThePeriodFour',
      'PeriodEndMinuteFour',
    ],
    'time5': [
      'AtTheBeginningOfThePeriodFive',
      'StartingPointOfTimePeriodFive',
      'AtTheEndOfThePeriodFive',
      'PeriodEndMinuteFive',
    ],
  };
}
